function fnW(str) {
    var num;
    str >= 10 ? num = str : num = "0" + str;
    return num;
}

var databb=[20,21,24,20,22,26,27,28,22,22,21,23,23,23,25,20,19,16,19,20,22,25,23,26,27,19,27,28,27];
var databbs=[18,17,20,20,20,22,24,23,18,20,18,20,17,18,20,17,16,15,15,19,17,22,10,25,23,17,25,22,22];
var datebb=['2019-09-01','2019-09-02','2019-09-03','2019-09-04','2019-09-05','2019-09-06','2019-09-07','2019-09-08','2019-09-09','2019-09-10','2019-09-11','2019-09-12','2019-09-13','2019-09-14','2019-09-15','2019-09-16','2019-09-17','2019-09-18','2019-09-19','2019-09-20','2019-09-21','2019-09-22','2019-09-23','2019-09-24','2019-09-25','2019-09-26','2019-09-27','2019-09-29'];

//获取当前时间
var timer = setInterval(function () {
    var date = new Date();
    var year = date.getFullYear(); //当前年份
    var month = date.getMonth(); //当前月份
    var data = date.getDate(); //天
    var hours = date.getHours(); //小时
    var minute = date.getMinutes(); //分
    var second = date.getSeconds(); //秒
    var day = date.getDay(); //获取当前星期几
    var ampm = hours < 12 ? 'am' : 'pm';
    $('#time').html(fnW(hours) + ":" + fnW(minute) + ":" + fnW(second));
    $('#date').html('<span>' + year + '/' + (month + 1) + '/' + data + '</span><span>' + ampm + '</span><span>周' + day + '</span>')

}, 1000);


//能耗占比
//var pie_fanzui =echarts.init(document.getElementById("pie_fanzui"),'macarons'); 
var pie_fanzui = echarts.init(document.getElementById("pie_fanzui"), 'infographic');

function bigdata_pie(id) {

    option = {
        title: {
            x: 'center'
        },
        tooltip: {
            trigger: 'item',
            formatter: "{a} <br/>{b} : {c} ({d}%)"
        },
        legend: {
            orient: 'vertical',
            left: 'left',
            data: ['日常养护','卫生清理','设施维护','植保工作'],
            textStyle: {color: '#fff'}
        },

        label: {
            normal: {
                textStyle: {
                    color: 'red'  // 改变标示文字的颜色
                }
            }
        },
        series: [
            {
                name: '养护类型和数量',
                type: 'pie',
                radius: '55%',
                center: ['50%', '60%'],
                data: [
                    {value:111, name:'日常养护'},
                    {value:135, name:'卫生清理'},
                    {value:148, name:'设施维护'},
                    {value:198, name:'植保工作'}

                ],

                itemStyle: {
                    emphasis: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,

                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    },
                    normal:{
                        color:function(params) {
                            //自定义颜色
                            var colorList = [
                                '#37A2DA', '#67E0E3', '#FFDB5C', '#E062AE', '#FF9F7F'
                            ];
                            return colorList[params.dataIndex]
                        }
                    }
                }

            }
        ]
    };


    pie_fanzui.setOption(option);

    $.ajax({
        type: "post",
        async: true, //异步请求
        url: "http://180.76.163.54/demo/statistics/energychartpiest.json",
      //  url: "statistics/energychartpiestbigdatapie.json",
        data: {
            poj: id,
            datatype: "Pie"
        },
        dataType: "json",
        success: function (result) {
            console.log(result);
            let msg = [];
            let data = [];
            for (var i = 0; i < result.length; i++) {
                msg.push(result[i].name);
                let obj = {
                    value: result[i].data,
                    name: result[i].name

                };
                data.push(obj);
            }

        },
        error: function (errorMsg) {
            //请求失败时执行该函数
            //alert("图表请求数据失败!");
        }
    });
}


//----------------------能耗占比end---------------


//===================能耗展示=======================
//var line_time =echarts.init(document.getElementById("line_time"),'shine'); 

//var line_time =echarts.init(document.getElementById("line_time"),'infographic');
function shus(id) {

    $.ajax({
        type: "post",
        async: true, //异步请求
        url: "http://180.76.163.54/demo/statistics/bigdatainstantaneous.json",
        data: {
            poj: id,
            datatype: "ColdHot"
        },
        dataType: "json",
        success: function (result) {
            let data = [];
            let date = [];
            if (result.status) {

                for (let i = 0; i < result.data.length; i++) {
                    data.push(result.data[i].data);
                    date.push(result.data[i].date);
                }

                var line_time = echarts.init(document.getElementById("line_time"), 'macarons');

                option = {
                    color: ['#27727B'],
                    tooltip: {
                        trigger: 'axis',
                        axisPointer: {
                            type: 'cross',
                            crossStyle: {
                                color: '#999'
                            }
                        }
                    },
                    grid: {
                        x: 50,
                        y: 50,
                        x2: 40,
                        y2: 30
                    },
                    dataZoom: [//给x轴设置滚动条
                        {
                            start: 0,//默认为0
                            end: 100,//默认为100
                            type: 'slider',
                            show: true,
                            xAxisIndex: [0],
                            handleSize: 0,//滑动条的 左右2个滑动条的大小
                            height:8,//组件高度
                            left: 50, //左边的距离
                            right: 40,//右边的距离
                            bottom: 0,//右边的距离
                            handleColor: '#ddd',//h滑动图标的颜色
                            handleStyle: {
                                borderColor: "#cacaca",
                                borderWidth: "1",
                                shadowBlur: 2,
                                background: "#ddd",
                                shadowColor: "#ddd",
                            },
                            fillerColor: new echarts.graphic.LinearGradient(1, 0, 0, 0, [{
                                //给颜色设置渐变色 前面4个参数，给第一个设置1，第四个设置0 ，就是水平渐变
                                //给第一个设置0，第四个设置1，就是垂直渐变
                                offset: 0,
                                color: '#1eb5e5'
                            }, {
                                offset: 1,
                                color: '#5ccbb1'
                            }]),
                            backgroundColor: '#ddd',//两边未选中的滑动条区域的颜色
                            showDataShadow: false,//是否显示数据阴影 默认auto
                            showDetail: false,//即拖拽时候是否显示详细数值信息 默认true
                            handleIcon: 'M-292,322.2c-3.2,0-6.4-0.6-9.3-1.9c-2.9-1.2-5.4-2.9-7.6-5.1s-3.9-4.8-5.1-7.6c-1.3-3-1.9-6.1-1.9-9.3c0-3.2,0.6-6.4,1.9-9.3c1.2-2.9,2.9-5.4,5.1-7.6s4.8-3.9,7.6-5.1c3-1.3,6.1-1.9,9.3-1.9c3.2,0,6.4,0.6,9.3,1.9c2.9,1.2,5.4,2.9,7.6,5.1s3.9,4.8,5.1,7.6c1.3,3,1.9,6.1,1.9,9.3c0,3.2-0.6,6.4-1.9,9.3c-1.2,2.9-2.9,5.4-5.1,7.6s-4.8,3.9-7.6,5.1C-285.6,321.5-288.8,322.2-292,322.2z',
                            filterMode: 'filter',
                        },
                        //下面这个属性是里面拖到
                        {
                            type: 'inside',
                            show: true,
                            xAxisIndex: [0],
                            start: 0,//默认为1
                            end: 100 - 1500 / 31,//默认为100
                        },
                    ],
                    xAxis: [
                        {
                            type: 'category',
                            data: date,
                            axisTick: {
                                alignWithLabel: true
                            }
                        }
                    ],
                    yAxis: [
                        {
                            type: 'value'
                        }
                    ],
                    series: [
                        {
                            name: '逐时能耗',
                            type: 'bar',
                            barWidth: '60%',
                            data: data,
                            itemStyle: {
                                normal: {
                                    color: new echarts.graphic.LinearGradient(
                                        0, 0, 0, 1,
                                        [
                                            {offset: 0, color: '#06B5D7'},                   //柱图渐变色
                                            {offset: 0.5, color: '#44C0C1'},                 //柱图渐变色
                                            {offset: 1, color: '#71C8B1'},                   //柱图渐变色
                                        ]
                                    )
                                },
                                emphasis: {
                                    color: new echarts.graphic.LinearGradient(
                                        0, 0, 0, 1,
                                        [
                                            {offset: 0, color: '#71C8B1'},                  //柱图高亮渐变色
                                            {offset: 0.7, color: '#44C0C1'},                //柱图高亮渐变色
                                            {offset: 1, color: '#06B5D7'}                   //柱图高亮渐变色
                                        ]
                                    )
                                }
                            }
                        }
                    ]
                };
                line_time.setOption(option);

            }
        },
        error: function (errorMsg) {
            //请求失败时执行该函数
            //alert("图表请求数据失败!");
        }
    });

  /*  let data = [];
    let time = [];
    let datass = [];
    let timess = [];
    $.ajax({
        type: "post",
        async: false, //异步请求
        url: "statistics/dianliangdata.json",
        data: {
            poj: id,
            datatype: "Instantaneous",
            dateif: "bigdata"
        },
        dataType: "json",
        success: function (result) {
            console.log(result)
            if (result.status) {
                for (let i = 0; i < result.data.length; i++) {
                    data.push(result.data[i].data);
                    time.push(result.data[i].date);
                }
            }
        },
        error: function (errorMsg) {
            //请求失败时执行该函数
            //alert("图表请求数据失败!");
        }
    });


    $.ajax({
        type: "post",
        async: false, //异步请求
        url: "statistics/bigdatainstantaneous.json",
        data: {
            poj: id,
            datatype: "ColdHot",
            dateif: ""
        },
        dataType: "json",
        success: function (result) {
            console.log(result)
            if (result.status) {

                for (let i = 0; i < result.data.length; i++) {
                    datass.push(result.data[i].data);
                    timess.push(result.data[i].date);
                }

            }
        },
        error: function (errorMsg) {
            //请求失败时执行该函数
            //alert("图表请求数据失败!");
        }
    });*/



   /* if (option && typeof option === "object") {
        myChart.setOption(option, true);
    }
    var option = {
        tooltip: {
            trigger: 'axis',
            axisPointer: {
                type: 'cross',
                crossStyle: {
                    color: '#999'
                }
            }
        },
        grid: {
            x: 50,
            y: 50,
            x2: 40,
            y2: 30
        },
        dataZoom: [//给x轴设置滚动条
            {
                start: 100,//默认为0
                end: 90,//默认为100
                type: 'slider',
                show: true,
                xAxisIndex: [0],
                handleSize: 0,//滑动条的 左右2个滑动条的大小
                height:8,//组件高度
                left: 50, //左边的距离
                right: 40,//右边的距离
                bottom: 0,//右边的距离
                handleColor: '#ddd',//h滑动图标的颜色
                handleStyle: {
                    borderColor: "#cacaca",
                    borderWidth: "1",
                    shadowBlur: 2,
                    background: "#ddd",
                    shadowColor: "#ddd",
                },
                fillerColor: new echarts.graphic.LinearGradient(1, 0, 0, 0, [{
                    //给颜色设置渐变色 前面4个参数，给第一个设置1，第四个设置0 ，就是水平渐变
                    //给第一个设置0，第四个设置1，就是垂直渐变
                    offset: 0,
                    color: '#1eb5e5'
                }, {
                    offset: 1,
                    color: '#5ccbb1'
                }]),
                backgroundColor: '#ddd',//两边未选中的滑动条区域的颜色
                showDataShadow: false,//是否显示数据阴影 默认auto
                showDetail: false,//即拖拽时候是否显示详细数值信息 默认true
                handleIcon: 'M-292,322.2c-3.2,0-6.4-0.6-9.3-1.9c-2.9-1.2-5.4-2.9-7.6-5.1s-3.9-4.8-5.1-7.6c-1.3-3-1.9-6.1-1.9-9.3c0-3.2,0.6-6.4,1.9-9.3c1.2-2.9,2.9-5.4,5.1-7.6s4.8-3.9,7.6-5.1c3-1.3,6.1-1.9,9.3-1.9c3.2,0,6.4,0.6,9.3,1.9c2.9,1.2,5.4,2.9,7.6,5.1s3.9,4.8,5.1,7.6c1.3,3,1.9,6.1,1.9,9.3c0,3.2-0.6,6.4-1.9,9.3c-1.2,2.9-2.9,5.4-5.1,7.6s-4.8,3.9-7.6,5.1C-285.6,321.5-288.8,322.2-292,322.2z',
                filterMode: 'filter',
            },
            //下面这个属性是里面拖到
            {
                type: 'inside',
                show: true,
                xAxisIndex: [0],
                start: 0,//默认为1
                end: 100 - 1500 / 31,//默认为100
            },
        ],
        legend: {
            data: ['总能耗', '设备能耗'],
            textStyle: {
                color: '#fft'
            }
        },
        xAxis: [
            {
                type: 'category',
                data:  timess,
                axisPointer: {
                    type: 'shadow'
                }
            }
        ],
        yAxis: [
            {
                type: 'value',
                name: '电量',
                min: 0,
                axisLabel: {
                    formatter: '{value} 度'
                }
            },
            {
                type: 'value',
                name: '电量',
                min: 0,
                max: 5,
                interval: 1,
                axisLabel: {
                    formatter: '{value} 度'
                }
            }
        ],
        series: [
            {
                name: '设备能耗',
                type: 'bar',
                data: datass
            },
            {
                name: '总能耗',
                type: 'line',
                data: data
            },

        ]
    };*/




}

//合并两个数组，去重
var concat_ = function (time, timess) {
    //不要直接使用var arr = arr1，这样arr只是arr1的一个引用，两者的修改会互相影响
    var arr = time.concat();
    //或者使用slice()复制，var arr = arr1.slice(0)
    for (var i = 0; i < timess.length; i++) {
        arr.indexOf(timess[i]) === -1 ? arr.push(timess[i]) : 0;
    }
    return arr;
};


//=========室内外温度开始=======================
//var qufenbu_data =echarts.init(document.getElementById("qufenbu_data"),'shine'); 
//var qufenbu_data =echarts.init(document.getElementById("qufenbu_data"),'macarons');
function bigdata_wd(id) {
    var qufenbu_data = echarts.init(document.getElementById("qufenbu_data"), 'infographic');
    var data = [];
    var time = [];
    var datas = [];
    var times = [];
    $.ajax({
        type: "post",
        async: true, //异步请求
        url: "http://180.76.163.54/demo/statistics/big_data_temperature.jhtml",
        data: {
            poj: id
        },
        dataType: "json",
        success: function (result) {
            if (result.status) {
                for (let i = 0; i < result.data.length; i++) {//内温度
                    data.push(result.data[i].data);
                    time.push(new Date(result.data[i].addTime).format("yyyy-MM-dd HH:mm:ss"));

                }
                for (let i = 0; i < result.datas.length; i++) {//外温度
                    datas.push(result.datas[i].data);
                    times.push(new Date(result.datas[i].addTime).format("yyyy-MM-dd HH:mm:ss"));

                }
            }
            var symbolSize = 10;
            option = {
                color: ['#7FFF00'],
                tooltip: {
                    trigger: 'axis'
                },

                dataZoom: [//给x轴设置滚动条
                    {
                        start: 0,//默认为0
                        end: 100,//默认为100
                        type: 'slider',
                        show: true,
                        xAxisIndex: [0],
                        handleSize: 0,//滑动条的 左右2个滑动条的大小
                        height: 8,//组件高度
                        left: 50, //左边的距离
                        right: 40,//右边的距离
                        bottom: 26,//右边的距离
                        handleColor: '#ddd',//h滑动图标的颜色
                        handleStyle: {
                            borderColor: "#cacaca",
                            borderWidth: "1",
                            shadowBlur: 2,
                            background: "#ddd",
                            shadowColor: "#ddd",
                        },
                        fillerColor: new echarts.graphic.LinearGradient(1, 0, 0, 0, [{
                            //给颜色设置渐变色 前面4个参数，给第一个设置1，第四个设置0 ，就是水平渐变
                            //给第一个设置0，第四个设置1，就是垂直渐变
                            offset: 0,
                            color: '#1eb5e5'
                        }, {
                            offset: 1,
                            color: '#5ccbb1'
                        }]),
                        backgroundColor: '#ddd',//两边未选中的滑动条区域的颜色
                        showDataShadow: false,//是否显示数据阴影 默认auto
                        showDetail: false,//即拖拽时候是否显示详细数值信息 默认true
                        handleIcon: 'M-292,322.2c-3.2,0-6.4-0.6-9.3-1.9c-2.9-1.2-5.4-2.9-7.6-5.1s-3.9-4.8-5.1-7.6c-1.3-3-1.9-6.1-1.9-9.3c0-3.2,0.6-6.4,1.9-9.3c1.2-2.9,2.9-5.4,5.1-7.6s4.8-3.9,7.6-5.1c3-1.3,6.1-1.9,9.3-1.9c3.2,0,6.4,0.6,9.3,1.9c2.9,1.2,5.4,2.9,7.6,5.1s3.9,4.8,5.1,7.6c1.3,3,1.9,6.1,1.9,9.3c0,3.2-0.6,6.4-1.9,9.3c-1.2,2.9-2.9,5.4-5.1,7.6s-4.8,3.9-7.6,5.1C-285.6,321.5-288.8,322.2-292,322.2z',
                        filterMode: 'filter',
                    },
                    //下面这个属性是里面拖到
                    {
                        type: 'inside',
                        show: true,
                        xAxisIndex: [0],
                        start: 0,//默认为1
                        end: 100 - 1500 / 31,//默认为100
                    },
                ],
                legend: {
                    padding:[32,0,0,0],
                    data: ['室外温度', '土壤温度'],
                    textStyle: {
                        color: '#fft'
                    }
                },
                xAxis: {
                    type: 'category',
                    boundaryGap: true,
                    data: datebb,
                    axisLabel: {
                        color: "#FADB71" //刻度线标签颜色
                    }
                },
                yAxis: {
                    type: 'value',
                    axisLabel: {
                        formatter: '{value} °C',
                        color: "#FADB71"
                    }
                },
                series: [
                    {
                        name: '室外温度',
                        symbolSize: symbolSize,
                        type: 'line',
                        data: databbs

                    },
                    {
                        name: '土壤温度',
                        symbolSize: symbolSize,
                        type: 'line',
                        areaStyle: {},
                        data: databb
                    }
                ]
            };


            qufenbu_data.setOption(option);
        },
        error: function (errorMsg) {
            //请求失败时执行该函数
            //alert("图表请求数据失败!");
        }
    });

}

//=========室内外温度曲线结束=======================

//=========室内外湿度曲线开始=======================
//var qufenbu_data =echarts.init(document.getElementById("qufenbu_data"),'shine'); 
//var qufenbu_data =echarts.init(document.getElementById("qufenbu_data"),'macarons'); 

function humidity(id) {
    var qufenbu_data = echarts.init(document.getElementById("xuncha_data"), 'infographic');
    var data = [];
    var time = [];
    var datas = [];
    var times = [];
    $.ajax({
        type: "post",
        async: false, //异步请求
        url: "http://180.76.163.54/demo/statistics/big_data_temperatures.jhtml",
        data: {
            poj: id
        },
        dataType: "json",
        success: function (result) {
            if (result.status) {
                for (let i = 0; i < result.data.length; i++) {//外温度
                    data.push(result.data[i].data);
                    time.push(new Date(result.data[i].addTime).format("yyyy-MM-dd HH:mm:ss"));
                }
                for (let i = 0; i < result.datas.length; i++) {//内温度
                    datas.push(result.datas[i].humidity);

                    times.push(new Date(result.datas[i].addTime).format("yyyy-MM-dd HH:mm:ss"));
                }
            }

        },
        error: function (errorMsg) {
            //请求失败时执行该函数
            //alert("图表请求数据失败!");
        }
    });
    var symbolSize = 10;
    option = {
        color: ['#7FFF00'],
        tooltip: {
            trigger: 'axis'
        },
        dataZoom: [//给x轴设置滚动条
            {
                start: 0,//默认为0
                end: 100,//默认为100
                type: 'slider',
                show: true,
                xAxisIndex: [0],
                handleSize: 0,//滑动条的 左右2个滑动条的大小
                height: 8,//组件高度
                left: 50, //左边的距离
                right: 40,//右边的距离
                bottom: 26,//右边的距离
                handleColor: '#ddd',//h滑动图标的颜色
                handleStyle: {
                    borderColor: "#cacaca",
                    borderWidth: "1",
                    shadowBlur: 2,
                    background: "#ddd",
                    shadowColor: "#ddd",
                },
                fillerColor: new echarts.graphic.LinearGradient(1, 0, 0, 0, [{
                    //给颜色设置渐变色 前面4个参数，给第一个设置1，第四个设置0 ，就是水平渐变
                    //给第一个设置0，第四个设置1，就是垂直渐变
                    offset: 0,
                    color: '#1eb5e5'
                }, {
                    offset: 1,
                    color: '#5ccbb1'
                }]),
                backgroundColor: '#ddd',//两边未选中的滑动条区域的颜色
                showDataShadow: false,//是否显示数据阴影 默认auto
                showDetail: false,//即拖拽时候是否显示详细数值信息 默认true
                handleIcon: 'M-292,322.2c-3.2,0-6.4-0.6-9.3-1.9c-2.9-1.2-5.4-2.9-7.6-5.1s-3.9-4.8-5.1-7.6c-1.3-3-1.9-6.1-1.9-9.3c0-3.2,0.6-6.4,1.9-9.3c1.2-2.9,2.9-5.4,5.1-7.6s4.8-3.9,7.6-5.1c3-1.3,6.1-1.9,9.3-1.9c3.2,0,6.4,0.6,9.3,1.9c2.9,1.2,5.4,2.9,7.6,5.1s3.9,4.8,5.1,7.6c1.3,3,1.9,6.1,1.9,9.3c0,3.2-0.6,6.4-1.9,9.3c-1.2,2.9-2.9,5.4-5.1,7.6s-4.8,3.9-7.6,5.1C-285.6,321.5-288.8,322.2-292,322.2z',
                filterMode: 'filter',
            },
            //下面这个属性是里面拖到
            {
                type: 'inside',
                show: true,
                xAxisIndex: [0],
                start: 0,//默认为1
                end: 100 - 1500 / 31,//默认为100
            },
        ],
        legend: {
            padding:[26,0,0,0],
            data: ['室外湿度', '土壤湿度'],
            textStyle: {
                color: '#fft'
            }
        },
        xAxis: {
            type: 'category',
            boundaryGap: false,
            data: datebb,
            axisLabel: {
                color: "#FADB71" //刻度线标签颜色
            }
        },
        yAxis: {
            type: 'value',
            axisLabel: {
                formatter: '{value} %',
                color: "#FADB71"
            }
        },
        series: [
            {
                name: '室外湿度',
                type: 'line',
                symbolSize: symbolSize,
                data: databbs

            },
            {
                name: '土壤湿度',
                type: 'line',
                symbolSize: symbolSize,
                areaStyle: {},
                data: databb
            }
        ]
    };

    qufenbu_data.setOption(option);

}


//=========室内外湿度曲线结束=======================

//===================二氧化碳浓度曲线=======================
//var line_time =echarts.init(document.getElementById("line_time"),'shine'); 
//var line_time =echarts.init(document.getElementById("line_time2"),'macarons'); 
var line_time = echarts.init(document.getElementById("line_time2"), 'infographic');

function Contrast(id) {
    option = {
        //   color: ['#27727B'],
        tooltip: {
            trigger: 'axis',
            axisPointer: {
                type: 'cross',
                label: {
                    backgroundColor: '#7FFF00'
                }
            }
        },
        dataZoom: [//给x轴设置滚动条
            {
                start: 0,//默认为0
                end: 100,//默认为100
                type: 'slider',
                show: true,
                xAxisIndex: [0],
                handleSize: 0,//滑动条的 左右2个滑动条的大小
                height:8,//组件高度
                left: 50, //左边的距离
                right: 40,//右边的距离
                bottom: 0,//右边的距离
                handleColor: '#ddd',//h滑动图标的颜色
                handleStyle: {
                    borderColor: "#cacaca",
                    borderWidth: "1",
                    shadowBlur: 2,
                    background: "#ddd",
                    shadowColor: "#ddd",
                },
                fillerColor: new echarts.graphic.LinearGradient(1, 0, 0, 0, [{
                    //给颜色设置渐变色 前面4个参数，给第一个设置1，第四个设置0 ，就是水平渐变
                    //给第一个设置0，第四个设置1，就是垂直渐变
                    offset: 0,
                    color: '#1eb5e5'
                }, {
                    offset: 1,
                    color: '#5ccbb1'
                }]),
                backgroundColor: '#ddd',//两边未选中的滑动条区域的颜色
                showDataShadow: false,//是否显示数据阴影 默认auto
                showDetail: false,//即拖拽时候是否显示详细数值信息 默认true
                handleIcon: 'M-292,322.2c-3.2,0-6.4-0.6-9.3-1.9c-2.9-1.2-5.4-2.9-7.6-5.1s-3.9-4.8-5.1-7.6c-1.3-3-1.9-6.1-1.9-9.3c0-3.2,0.6-6.4,1.9-9.3c1.2-2.9,2.9-5.4,5.1-7.6s4.8-3.9,7.6-5.1c3-1.3,6.1-1.9,9.3-1.9c3.2,0,6.4,0.6,9.3,1.9c2.9,1.2,5.4,2.9,7.6,5.1s3.9,4.8,5.1,7.6c1.3,3,1.9,6.1,1.9,9.3c0,3.2-0.6,6.4-1.9,9.3c-1.2,2.9-2.9,5.4-5.1,7.6s-4.8,3.9-7.6,5.1C-285.6,321.5-288.8,322.2-292,322.2z',
                filterMode: 'filter',
            },
            //下面这个属性是里面拖到
            {
                type: 'inside',
                show: true,
                xAxisIndex: [0],
                start: 0,//默认为1
                end: 100 - 1500 / 31,//默认为100
            },
        ],
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        xAxis: [
            {
                type: 'category',
                boundaryGap: true,
                data: datebb,
                axisLabel: {
                    color: "#FADB71" //刻度线标签颜色
                }

            }
        ],
        yAxis: [
            {
                type: 'value',
                axisLabel: {
                    color: "#FADB71" //刻度线标签颜色
                }
            }
        ],
        series:  [
            {
                name: '喷灌用水量',
                type: 'bar',
                barWidth: '60%',
                data: databb,
                itemStyle: {
                    normal: {
                        color: new echarts.graphic.LinearGradient(
                            0, 0, 0, 1,
                            [
                                {offset: 0, color: '#06B5D7'},                   //柱图渐变色
                                {offset: 0.5, color: '#44C0C1'},                 //柱图渐变色
                                {offset: 1, color: '#71C8B1'},                   //柱图渐变色
                            ]
                        )
                    },
                    emphasis: {
                        color: new echarts.graphic.LinearGradient(
                            0, 0, 0, 1,
                            [
                                {offset: 0, color: '#71C8B1'},                  //柱图高亮渐变色
                                {offset: 0.7, color: '#44C0C1'},                //柱图高亮渐变色
                                {offset: 1, color: '#06B5D7'}                   //柱图高亮渐变色
                            ]
                        )
                    }
                }
            }
        ]
    };
    line_time.setOption(option);
    $.ajax({
        type: "post",
        async: true, //异步请求
        url: "http://180.76.163.54/demo/statistics/bigdataand.json",
        data: {
            poj: id,
            datatype: "ColdHot",
        /*    poj: id,
            datatype: "MandD"*/
        },
        dataType: "json",
        success: function (result) {
            let data = [];
            let date = [];
            if (result.status) {

                for (let i = 0; i < result.data.length; i++) {
                    data.push(result.data[i].data);
                    date.push(result.data[i].date);
                }

            }

   /*         console.log(result)
            let msg = [];
            let data = [];
            let time;
            for (var i = 0; i < result.length; i++) {
                msg.push(result[i].name);
                time = result[i].timelist;
                if (i==0){
                    let obj = {
                        name: result[i].name,
                        type: 'line',
                        stack: '总量',
                        //areaStyle: {},
                        data: result[i].datalist
                    };
                    data.push(obj);
                }else{
                    let obj = {

                        name: result[i].name,
                        type: 'line',
                        areaStyle: {},
                        data: result[i].datalist
                    };
                    data.push(obj);
                }


            }*/

        },
        error: function (errorMsg) {
            //请求失败时执行该函数
            //alert("图表请求数据失败!");
        }
    });


}




